#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	int maxProduct(vector<string>& words)
	{
		int* masks = (int*)calloc(words.size(), sizeof(int)); int size = 0;
		for (auto& word : words) {
			int m = 0;
			for (auto ch : word)
				m |= 1 << ch - 'a';
			masks[size++] = m;
		}

		int res=0;
		for (int i = 0, len = words.size(); i < len; i++)
			for (int j = i + 1; j < len; j++)
				if (!(masks[i] & masks[j])) res = max((int)(words[i].size() * words[j].size()), res);

		return res;
	}

private:
};

int main()
{
	Solution solution;
	return 0;
}
